//package com.caipiao.interceptor;
//
//import com.caipiao.util.CommonUtils;
//import org.springframework.web.servlet.HandlerInterceptor;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * Created by yangweijian on 2018/7/8.
// */
//public class Interceptor implements HandlerInterceptor {
//    /**
//     * 非app访问接口拦截
//     * @param request
//     * @param response
//     * @param handler
//     * @return
//     * @throws Exception
//     */
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
////        String signTime = request.getParameter("signTime");
////        String sign = request.getParameter("sign");
////        String invite = request.getParameter("invite");
////        if("yao".equals(invite)){
////            return true;
////        }
////        if (null == signTime || "".equals(signTime) || null == sign || "".equals(sign)){
////            return false;
////        }
////        long t = System.currentTimeMillis();
////        if(t-Long.parseLong(signTime)>5*1000){
////           return false;
////        }
////        String md5 = CommonUtils.getMD5(signTime + "kuayou123");
////        if(!md5.equals(sign)){
////            return false;
////        }
//        return true;
//    }
//
//    @Override
//    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
//
//    }
//
//    @Override
//    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
//
//    }
//}
